<div class="row">
	<div class="col-xs-12">
		<div class="box">
			<div class="box-header">
				<h3 class="box-title">日志管理</h3>
				<div class="box-tools">
					<div class="input-group input-group-sm" style="width: 350px;">
						<input type="text" name="table_search" id="searchNameId"
							class="form-control pull-right" placeholder="用户名">

						<div class="input-group-btn">
							<button type="button" class="btn btn-default btn-search">
                                <i class="fa fa-search"></i>
							</button>
							<button type="button" class="btn btn-default btn-delete">删除</button>
						</div>
					</div>
				</div>
			</div>
			<!-- /.box-header -->
			<div class="box-body table-responsive no-padding">
				<table class="table table-hover">
					<thead>
						<tr>
						    <th><input type="checkbox" id="checkAll">全选</th>
							<th>用户名</th>
							<th>操作</th>
							<th>请求方法</th>
							<th>请求参数</th>
							<th>IP</th>
							<th>执行时长</th>
						</tr>
					</thead>
					<tbody id="tbodyId">
					    <tr>
					       <td colspan="7">数据正在加载中...</td>
					    </tr>
					</tbody>
				</table>
			</div>
			<div id="pageId" class="box-footer clearfix" dm="100">
			  
			</div>
			<!-- /.box-body -->
		</div>
		<!-- /.box -->
	</div>
</div>
<script type="text/javascript">
   $(function(){
	  $("#pageId").load("dosysPageUI",function(){
		  doGetObjects();  
	  });
   });
   //发出异步请求数据
   function doGetObjects(){
	   var pageCurrent = $("#pageId").data("pageCurrent");
	   if(!pageCurrent) pageCurrent=1;
	   console.log(pageCurrent);
	   
	   var url = "log/doFindPageObjects";
	   var parmas = {"pageCurrent":pageCurrent};
	   
	   var username = $("#searchNameId").val();
	   if(username) parmas.username=username;
	   
	   $.getJSON(url,parmas,function(result){
		   //console.log(result);
		  	doFindPageObjects(result);
	   });
   }
   function doFindPageObjects(result){
	   if(result.state==1){
		   dosetpagecount(result.data.recosd);
		   //调用分页函数信息
		   dogetpageCount(result.data);
	   }else{
		   alert(result.message);
	   }
   }
   function dosetpagecount(recosd){
	   //遍历数组替换信息
	   var tbody = $("#tbodyId");
	   tbody.empty();
	   recosd.forEach(itme=>tbody.append(docreatedrow(itme)));
   }
   
   function docreatedrow(itme){
	   return `<tr>
	   	<td><input type='checkbox' value=${itme.id}/></td>
	   	<td>${itme.username}</td>
		<td>${itme.operation}</td>
		<td>${itme.method}</td>
		<td>${itme.params}</td>
		<td>${itme.ip}</td>
		<td>${itme.time}</td>
	   </tr>`
   }
   
</script>






